Skip to content

chore: relax jwt dependency to allow v3#208

Merged
shaljam merged 3 commits intomasterfrom
chore/jwt-v3-support
Apr 29, 2026
Merged

chore: relax jwt dependency to allow v3#208
shaljam merged 3 commits intomasterfrom
chore/jwt-v3-support

Conversation

@shaljam
Copy link
Copy Markdown
Contributor

@shaljam shaljam commented Apr 28, 2026

Summary

  • Relax jwt constraint in the gemspec to >= 2.10, < 4 so apps can resolve to ruby-jwt v3 (originally proposed in Relax jwt dependency to allow v3 #207 by @sergiopatricio, fixes Support jwt gem 3.x #204).
  • Add a CI matrix entry pinning jwt ~> 3.0 so v3 compatibility is verified by tests, not just by inspection.
  • Tighten spec/client_spec.rb to pass an explicit HS256 algorithm to JWT.decode — header-inferred algorithms have shifted across jwt major versions and are brittle.
  • Rename profanity_en_2020_v1 blocklist name to profanity.

Test plan

  • Default matrix (jwt 2.x) still passes on Ruby 3.0 / 3.1 / 3.4 / 4.0
  • New Ruby 4.0 (jwt ~> 3.0) matrix entry passes
  • Lint (rubocop + srb tc) still green on Ruby 3.4 / 4.0

🤖 Generated with Claude Code

Allow ruby-jwt v3 in addition to v2.x and add a CI matrix entry that
pins jwt ~> 3.0 so compat is verified by tests, not just by inspection.
Also tighten the JWT.decode call in spec/client_spec.rb to pass an
explicit HS256 algorithm — relying on header-inferred algorithms is
brittle across jwt versions.

Co-Authored-By: Sérgio Patrício <sergiopatricio@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread lib/stream-chat/client.rb
sorbet/rbi/hidden-definitions/hidden.rbi declared
StringScanner#initialize(*arg), which conflicts with sorbet's bundled
stdlib RBI signature (arg0, arg1=T.unsafe(nil)) and made `srb tc` fail
on Ruby 3.4. The latent error was masked because Ruby 3.4 has been
getting cancelled by earlier matrix failures for months.

This is a workaround; the root cause is a Ruby/Sorbet stdlib RBI
mismatch and a future `srb rbi hidden-definitions` regen may re-add
the line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shaljam shaljam force-pushed the chore/jwt-v3-support branch from ad1cf27 to 2e86461 Compare April 29, 2026 08:41
The server renamed the canonical built-in blocklist from
profanity_en_2020_v1 to profanity (chat PR #12716, MOD2-563). The
list_blocklists API now returns the new name, so list/get specs that
asserted on DEFAULT_BLOCKLIST were failing. Update the constant, the
doc comments, and the moderation_spec literal to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shaljam shaljam force-pushed the chore/jwt-v3-support branch from 3396486 to 5338f30 Compare April 29, 2026 09:13
@shaljam shaljam merged commit 8305806 into master Apr 29, 2026
5 checks passed
@shaljam shaljam deleted the chore/jwt-v3-support branch April 29, 2026 09:28
This was referenced Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support jwt gem 3.x

2 participants